package com.dgy.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgy.project.mapper.ProjectApplyFileMapper;
import com.dgy.project.domain.ProjectApplyFile;
import com.dgy.project.service.IProjectApplyFileService;

/**
 * 项目节点附件Service业务层处理
 *
 * @author ccc
 * @date 2025-03-26
 */
@Service
public class ProjectApplyFileServiceImpl implements IProjectApplyFileService
{
    @Autowired
    private ProjectApplyFileMapper projectApplyFileMapper;

    /**
     * 查询项目节点附件
     *
     * @param fileId 项目节点附件主键
     * @return 项目节点附件
     */
    @Override
    public ProjectApplyFile selectProjectApplyFileByFileId(Long fileId)
    {
        return projectApplyFileMapper.selectProjectApplyFileById(fileId);
    }

    /**
     * 查询项目节点附件列表
     *
     * @param projectApplyFile 项目节点附件
     * @return 项目节点附件
     */
    @Override
    public List<ProjectApplyFile> selectprojectApplyFileList(ProjectApplyFile projectApplyFile)
    {
        return projectApplyFileMapper.selectProjectApplyFileList(projectApplyFile);
    }

    /**
     * 新增项目节点附件
     *
     * @param projectApplyFile 项目节点附件
     * @return 结果
     */
    @Override
    public int insertProjectApplyFile(ProjectApplyFile projectApplyFile)
    {
        projectApplyFile.setCreateTime(DateUtils.getNowDate());
        return projectApplyFileMapper.insertProjectApplyFile(projectApplyFile);
    }

    @Override
    public int insertProjectApplyFileBatch(List<ProjectApplyFile> projectApplyFileList) {
        return 0;
    }

    /**
     * 修改项目节点附件
     *
     * @param projectApplyFile 项目节点附件
     * @return 结果
     */
    @Override
    public int updateProjectApplyFile(ProjectApplyFile projectApplyFile)
    {
        projectApplyFile.setUpdateTime(DateUtils.getNowDate());
        return projectApplyFileMapper.updateProjectApplyFile(projectApplyFile);
    }

    /**
     * 批量删除项目节点附件
     *
     * @param fileIds 需要删除的项目节点附件主键
     * @return 结果
     */
    @Override
    public int deleteProjectApplyFileByFileIds(Long[] fileIds)
    {
        return projectApplyFileMapper.deleteProjectApplyFileByIds(fileIds);
    }

    /**
     * 删除项目节点附件信息
     *
     * @param fileId 项目节点附件主键
     * @return 结果
     */
    @Override
    public int deleteProjectApplyFileByFileId(Long fileId)
    {
        return projectApplyFileMapper.deleteProjectApplyFileById(fileId);
    }

    /**
     * 删除项目节点附件信息
     *
     * @param fileId 项目节点附件主键
     * @return 结果
     */
    @Override
    public int deleteProjectApplyFileByApplyId(Long applyId) {
        return projectApplyFileMapper.deleteProjectApplyFileByApplyId(applyId);
    }
}
